﻿@model IPagedList<Movie>
@using Resources
<div id="movieList">

    <div class="pagedList" data-otf-target="#movieList">
        @Html.PagedListPager(Model, page =>  Url.Action("Index", new { page }),
        PagedListRenderOptions.MinimalWithItemCountText)
    </div>

    <table>
        <tr>
            <th></th>
            <th id="title">
                @MVResources.titel
            </th>
            <th id="genre">
                Genre
            </th>
            <th id="time">
                @MVResources.speelduur
            </th>
            <th id="director">
                @MVResources.regisseur
            </th>
        </tr>
    @foreach (var item in Model) {
        <tr id="movieRow">
            <td>
                <a href="@Url.Action("Details", "Movie", new { id = item.movieId })">
                    <img src="@Url.Content(item.movieImage)" alt="movie poster" runat="server"/>
                </a>
            </td>
            <td>
                @Html.ActionLink(item.movieTitle, "Details", new { id = item.movieId })
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.movieGenre.genreName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.movieLength) minuten
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.movieDirector)
            </td>
        </tr>
    }

    </table>
</div>


